package com.heima.article.client;

import com.heima.model.article.dtos.AuthorDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 *文章服务客户端
 */
@FeignClient("leadnews-article")
public interface ArticleFeignClient {

    /**
     * 新增作者
     */
    @PostMapping("/api/v1/author/save")
    Integer save(@RequestBody AuthorDto authorDto);

    /**
     * 通过用户id查询作者
     */
    @GetMapping("/api/v1/author/findByApUserId/{apUserId}")
    AuthorDto findByApUserId(@PathVariable("apUserId") Integer apUserId);
}
